package top.kaoshanji.p2ch06a;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Objects;

/**
 * 代码清单 p2ch06a-13：Objects类的toString方法的使用示例
 * author kaoshanji
 * ^_^
 * create time 2025/1/17 19:16
 */
public class ObjectsExample04 {

    private static final Logger logger = LogManager.getLogger(ObjectsExample04.class);

    public static void main(String[] args) {
        logger.info("...代码清单 p2ch06a-13：Objects类的toString方法的使用示例...");

        String str1 = Objects.toString("Hello");
        String str2 = Objects.toString(null, "空对象");

        logger.info("...str1:{}...", str1);
        logger.info("...str2:{}...", str2);

    }

}
